//
//  UIApplication.swift
//  Documentation
//
//  Created by Toj on 2/7/23.
//

public enum UIStatusBarStyle : Int {

    
    case `default` = 0 // Automatically chooses light or dark content based on the user interface style

    @available(iOS 7.0, *)
    case lightContent = 1 // Light content, for use on dark backgrounds

    @available(iOS 13.0, *)
    case darkContent = 3 // Dark content, for use on light backgrounds
}

public enum UIStatusBarAnimation : Int {

    
    case none = 0

    @available(iOS 3.2, *)
    case fade = 1

    @available(iOS 3.2, *)
    case slide = 2
}

// Note that UIInterfaceOrientationLandscapeLeft is equal to UIDeviceOrientationLandscapeRight (and vice versa).
// This is because rotating the device to the left requires rotating the content to the right.
public enum UIInterfaceOrientation : Int {

    
    case unknown = 0

    case portrait = 1

    case portraitUpsideDown = 2

    case landscapeLeft = 4

    case landscapeRight = 3
}

public struct UIInterfaceOrientationMask : OptionSet {

    public init(rawValue: UInt)

    
    public static var portrait: UIInterfaceOrientationMask { get }

    public static var landscapeLeft: UIInterfaceOrientationMask { get }

    public static var landscapeRight: UIInterfaceOrientationMask { get }

    public static var portraitUpsideDown: UIInterfaceOrientationMask { get }

    public static var landscape: UIInterfaceOrientationMask { get }

    public static var all: UIInterfaceOrientationMask { get }

    public static var allButUpsideDown: UIInterfaceOrientationMask { get }
}
extension UIInterfaceOrientation {

    
    public var isPortrait: Bool { get }

    
    public var isLandscape: Bool { get }
}

@available(iOS, introduced: 3.0, deprecated: 8.0, message: "Use UserNotifications Framework's UNAuthorizationOptions for user notifications and registerForRemoteNotifications for receiving remote notifications instead.")
public struct UIRemoteNotificationType : OptionSet {

    public init(rawValue: UInt)

    
    public static var badge: UIRemoteNotificationType { get }

    public static var sound: UIRemoteNotificationType { get }

    public static var alert: UIRemoteNotificationType { get }

    public static var newsstandContentAvailability: UIRemoteNotificationType { get }
}

@available(iOS 7.0, *)
public enum UIBackgroundFetchResult : UInt {

    
    case newData = 0

    case noData = 1

    case failed = 2
}

@available(iOS 7.0, *)
public enum UIBackgroundRefreshStatus : Int {

    
    case restricted = 0 // unavailable on this system due to device configuration; the user cannot enable the feature

    case denied = 1 // explicitly disabled by the user for this application

    case available = 2 // enabled for this application
}

public struct UIBackgroundTaskIdentifier : Hashable, Equatable, RawRepresentable {

    public init(rawValue: Int)
}
extension UIBackgroundTaskIdentifier {

    @available(iOS 4.0, *)
    public static let invalid: UIBackgroundTaskIdentifier
}
@available(iOS, introduced: 4.0, deprecated: 13.0, message: "Please use PushKit for VoIP applications.")
public let UIMinimumKeepAliveTimeout: TimeInterval

@available(iOS 2.0, *)
open class UIApplication : UIResponder {

    
    open class var shared: UIApplication { get }

    
    unowned(unsafe) open var delegate: UIApplicationDelegate?

    
    @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Use UIView's userInteractionEnabled property instead")
    open func beginIgnoringInteractionEvents() // nested. set should be set during animations & transitions to ignore touch and other events

    @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Use UIView's userInteractionEnabled property instead")
    open func endIgnoringInteractionEvents()

    @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Use UIView's userInteractionEnabled property instead")
    open var isIgnoringInteractionEvents: Bool { get } // returns YES if we are at least one deep in ignoring events

    
    open var isIdleTimerDisabled: Bool // default is NO

    
    @available(iOS, introduced: 2.0, deprecated: 10.0)
    open func openURL(_ url: URL) -> Bool

    @available(iOS 3.0, *)
    open func canOpenURL(_ url: URL) -> Bool

    
    // Options are specified in the section below for openURL options. An empty options dictionary will result in the same
    // behavior as the older openURL call, aside from the fact that this is asynchronous and calls the completion handler rather
    // than returning a result.
    // The completion handler is called on the main queue.
    @available(iOS 10.0, *)
    open func open(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any] = [:], completionHandler completion: ((Bool) -> Void)? = nil)

    @available(iOS 10.0, *)
    open func open(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any] = [:]) async -> Bool

    
    open func sendEvent(_ event: UIEvent)

    
    @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Should not be used for applications that support multiple scenes as it returns a key window across all connected scenes")
    open var keyWindow: UIWindow? { get }

    @available(iOS, introduced: 2.0, deprecated: 15.0, message: "Use UIWindowScene.windows on a relevant window scene instead")
    open var windows: [UIWindow] { get }

    
    open func sendAction(_ action: Selector, to target: Any?, from sender: Any?, for event: UIEvent?) -> Bool

    
    @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Provide a custom network activity UI in your app if desired.")
    open var isNetworkActivityIndicatorVisible: Bool

    
    @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Use the statusBarManager property of the window scene instead.")
    open var statusBarStyle: UIStatusBarStyle { get } // default is UIStatusBarStyleDefault

    
    @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Use the statusBarManager property of the window scene instead.")
    open var isStatusBarHidden: Bool { get }

    
    @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Use the interfaceOrientation property of the window scene instead.")
    open var statusBarOrientation: UIInterfaceOrientation { get }

    
    // The system only calls this method if the application delegate has not
    // implemented the delegate equivalent. It returns the orientations specified by
    // the application's info.plist. If no supported interface orientations were
    // specified it will return UIInterfaceOrientationMaskAll on an iPad and
    // UIInterfaceOrientationMaskAllButUpsideDown on a phone.  The return value
    // should be one of the UIInterfaceOrientationMask values which indicates the
    // orientations supported by this application.
    @available(iOS 6.0, *)
    open func supportedInterfaceOrientations(for window: UIWindow?) -> UIInterfaceOrientationMask

    
    @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Use viewWillTransitionToSize:withTransitionCoordinator: instead.")
    open var statusBarOrientationAnimationDuration: TimeInterval { get } // Returns the animation duration for the status bar during a 90 degree orientation change.  It should be doubled for a 180 degree orientation change.

    @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Use the statusBarManager property of the window scene instead.")
    open var statusBarFrame: CGRect { get } // returns CGRectZero if the status bar is hidden

    
    open var applicationIconBadgeNumber: Int // set to 0 to hide. default is 0. In iOS 8.0 and later, your application must register for user notifications using -[UIApplication registerUserNotificationSettings:] before being able to set the icon badge.

    
    @available(iOS 3.0, *)
    open var applicationSupportsShakeToEdit: Bool

    
    @available(iOS 4.0, *)
    open var applicationState: UIApplication.State { get }

    @available(iOS 4.0, *)
    open var backgroundTimeRemaining: TimeInterval { get }

    
    @available(iOS 4.0, *)
    open func beginBackgroundTask(expirationHandler handler: (() -> Void)? = nil) -> UIBackgroundTaskIdentifier

    @available(iOS 7.0, *)
    open func beginBackgroundTask(withName taskName: String?, expirationHandler handler: (() -> Void)? = nil) -> UIBackgroundTaskIdentifier

    @available(iOS 4.0, *)
    open func endBackgroundTask(_ identifier: UIBackgroundTaskIdentifier)

    
    /** The system guarantees that it will not wake up your application for a background fetch more
        frequently than the interval provided. Set to UIApplicationBackgroundFetchIntervalMinimum to be
        woken as frequently as the system desires, or to UIApplicationBackgroundFetchIntervalNever (the
        default) to never be woken for a background fetch.
     
        This setter will have no effect unless your application has the "fetch"
        UIBackgroundMode. See the UIApplicationDelegate method
        `application:performFetchWithCompletionHandler:` for more. */
    @available(iOS, introduced: 7.0, deprecated: 13.0, message: "Use a BGAppRefreshTask in the BackgroundTasks framework instead")
    open func setMinimumBackgroundFetchInterval(_ minimumBackgroundFetchInterval: TimeInterval)

    
    /** When background refresh is available for an application, it may launched or resumed in the background to handle significant
        location changes, remote notifications, background fetches, etc. Observe UIApplicationBackgroundRefreshStatusDidChangeNotification to
        be notified of changes. */
    @available(iOS 7.0, *)
    open var backgroundRefreshStatus: UIBackgroundRefreshStatus { get }

    
    @available(iOS 4.0, *)
    open var isProtectedDataAvailable: Bool { get }

    
    @available(iOS 5.0, *)
    open var userInterfaceLayoutDirection: UIUserInterfaceLayoutDirection { get }

    
    // Return the size category
    @available(iOS 7.0, *)
    open var preferredContentSizeCategory: UIContentSizeCategory { get }

    
    // All of the currently connected UIScene instances
    @available(iOS 13.0, *)
    open var connectedScenes: Set<UIScene> { get }

    
    // All of the representations that currently have connected UIScene instances or had their sessions persisted by the system (ex: visible in iOS' switcher)
    @available(iOS 13.0, *)
    open var openSessions: Set<UISceneSession> { get }

    
    // returns YES if the application both declares multiple scene support in its info.plist and the executing environment allows multiple scenes for at least one system type. NO otherwise.
    @available(iOS 13.0, *)
    open var supportsMultipleScenes: Bool { get }

    
    // Request a given session be activated, first connecting it to the application if necessary.
    // Providing a session will activate, connecting if necessary, the interface backed by the already existing UISceneSession.
    // Providing a user activity will dispatch that activity to the provided session's scene. If no session is provided, then the system will select one (possibly creating a new session, if appropriate) and pass the activity to the session scene's delegate.
    @available(iOS 13.0, *)
    open func requestSceneSessionActivation(_ sceneSession: UISceneSession?, userActivity: NSUserActivity?, options: UIScene.ActivationRequestOptions?, errorHandler: ((Error) -> Void)? = nil)

    
    // requests that a given session be closed, disconnecting the currently connected scene if present, and calling the -application:didDiscardSceneSessions: method on the application's delegate
    @available(iOS 13.0, *)
    open func requestSceneSessionDestruction(_ sceneSession: UISceneSession, options: UISceneDestructionRequestOptions?, errorHandler: ((Error) -> Void)? = nil)

    
    // requests that any system UI representing a scene be updated due to background updates or any other relevant model/state update.
    @available(iOS 13.0, *)
    open func requestSceneSessionRefresh(_ sceneSession: UISceneSession)
}

extension UIApplication {

    
    // Calling this will result in either application:didRegisterForRemoteNotificationsWithDeviceToken: or application:didFailToRegisterForRemoteNotificationsWithError: to be called on the application delegate. Note: these callbacks will be made only if the application has successfully registered for user notifications with registerUserNotificationSettings:, or if it is enabled for Background App Refresh.
    @available(iOS 8.0, *)
    open func registerForRemoteNotifications()

    
    @available(iOS 3.0, *)
    open func unregisterForRemoteNotifications()

    
    // Returns YES if the application is currently registered for remote notifications, taking into account any systemwide settings; doesn't relate to connectivity.
    @available(iOS 8.0, *)
    open var isRegisteredForRemoteNotifications: Bool { get }

    
    @available(iOS, introduced: 3.0, deprecated: 8.0, message: "Use -[UIApplication registerForRemoteNotifications] and UserNotifications Framework's -[UNUserNotificationCenter requestAuthorizationWithOptions:completionHandler:]")
    open func registerForRemoteNotifications(matching types: UIRemoteNotificationType)

    
    // Returns the enabled types, also taking into account any systemwide settings; doesn't relate to connectivity.
    @available(iOS, introduced: 3.0, deprecated: 8.0, message: "Use -[UIApplication isRegisteredForRemoteNotifications] and UserNotifications Framework's -[UNUserNotificationCenter getNotificationSettingsWithCompletionHandler:] to retrieve user-enabled remote notification and user notification settings")
    open func enabledRemoteNotificationTypes() -> UIRemoteNotificationType
}

// In iOS 8.0 and later, your application must register for user notifications using -[UIApplication registerUserNotificationSettings:] before being able to schedule and present UILocalNotifications
extension UIApplication {

    
    @available(iOS, introduced: 4.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenter addNotificationRequest:withCompletionHandler:]")
    open func presentLocalNotificationNow(_ notification: UILocalNotification)

    
    @available(iOS, introduced: 4.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenter addNotificationRequest:withCompletionHandler:]")
    open func scheduleLocalNotification(_ notification: UILocalNotification) // copies notification

    @available(iOS, introduced: 4.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenter removePendingNotificationRequestsWithIdentifiers:]")
    open func cancelLocalNotification(_ notification: UILocalNotification)

    @available(iOS, introduced: 4.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenter removeAllPendingNotificationRequests]")
    open func cancelAllLocalNotifications()

    
    @available(iOS, introduced: 4.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenter getPendingNotificationRequestsWithCompletionHandler:]")
    open var scheduledLocalNotifications: [UILocalNotification]?
}

extension UIApplication {

    
    // Registering UIUserNotificationSettings more than once results in previous settings being overwritten.
    @available(iOS, introduced: 8.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenter requestAuthorizationWithOptions:completionHandler:] and -[UNUserNotificationCenter setNotificationCategories:]")
    open func registerUserNotificationSettings(_ notificationSettings: UIUserNotificationSettings)

    
    // Returns the enabled user notification settings, also taking into account any systemwide settings.
    @available(iOS, introduced: 8.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenter getNotificationSettingsWithCompletionHandler:] and -[UNUserNotificationCenter getNotificationCategoriesWithCompletionHandler:]")
    open var currentUserNotificationSettings: UIUserNotificationSettings? { get }
}

extension UIApplication {

    
    @available(iOS 4.0, *)
    open func beginReceivingRemoteControlEvents()

    @available(iOS 4.0, *)
    open func endReceivingRemoteControlEvents()
}

extension UIApplication {

    @available(iOS, introduced: 5.0, deprecated: 9.0, message: "Newsstand apps now behave like normal apps on SpringBoard")
    open func setNewsstandIconImage(_ image: UIImage?)
}

extension UIApplication {

    // Register shortcuts to display on the home screen, or retrieve currently registered shortcuts.
    @available(iOS 9.0, *)
    open var shortcutItems: [UIApplicationShortcutItem]?
}

extension UIApplication {

    // If false, alternate icons are not supported for the current process.
    @available(iOS 10.3, *)
    open var supportsAlternateIcons: Bool { get }

    
    // Pass `nil` to use the primary application icon. The completion handler will be invoked asynchronously on an arbitrary background queue; be sure to dispatch back to the main queue before doing any further UI work.
    @available(iOS 10.3, *)
    open func setAlternateIconName(_ alternateIconName: String?, completionHandler: ((Error?) -> Void)? = nil)

    @available(iOS 10.3, *)
    open func setAlternateIconName(_ alternateIconName: String?) async throws

    
    // If `nil`, the primary application icon is being used.
    @available(iOS 10.3, *)
    open var alternateIconName: String? { get }
}

extension UIApplication {

    // These methods are used to inform the system that state restoration is occurring asynchronously after the application
    // has processed its restoration archive on launch. In the even of a crash, the system will be able to detect that it may
    // have been caused by a bad restoration archive and arrange to ignore it on a subsequent application launch.
    @available(iOS 6.0, *)
    open func extendStateRestoration()

    @available(iOS 6.0, *)
    open func completeStateRestoration()

    
    // Indicate the application should not use the snapshot on next launch, even if there is a valid state restoration archive.
    // This should only be called from methods invoked from State Preservation, else it is ignored.
    @available(iOS 7.0, *)
    open func ignoreSnapshotOnNextApplicationLaunch()

    
    // Register non-View/ViewController objects for state restoration so other objects can reference them within state restoration archives.
    // If the object implements encode/decode, those methods will be called during save/restore.
    // Obj and identifier must not be nil, or will raise UIRestorationObjectRegistrationException.
    // Objects do not need to be unregistered when they are deleted, the State Restoration system will notice and stop tracking the object.
    @available(iOS 7.0, *)
    open class func registerObject(forStateRestoration object: UIStateRestoring, restorationIdentifier: String)
}
extension UIApplication {

    
    public struct LaunchOptionsKey : Hashable, Equatable, RawRepresentable {

        public init(rawValue: String)
    }

    
    public struct OpenURLOptionsKey : Hashable, Equatable, RawRepresentable {

        public init(rawValue: String)
    }
    
    public struct ExtensionPointIdentifier : Hashable, Equatable, RawRepresentable {

        public init(rawValue: String)
    }

    @available(iOS 4.0, *)
    public class let didEnterBackgroundNotification: NSNotification.Name

    @available(iOS 4.0, *)
    public class let willEnterForegroundNotification: NSNotification.Name

    public class let didFinishLaunchingNotification: NSNotification.Name

    public class let didBecomeActiveNotification: NSNotification.Name

    public class let willResignActiveNotification: NSNotification.Name

    public class let didReceiveMemoryWarningNotification: NSNotification.Name

    public class let willTerminateNotification: NSNotification.Name

    public class let significantTimeChangeNotification: NSNotification.Name

    @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Use viewWillTransitionToSize:withTransitionCoordinator: instead.")
    public class let willChangeStatusBarOrientationNotification: NSNotification.Name // userInfo contains NSNumber with new orientation

    @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Use viewWillTransitionToSize:withTransitionCoordinator: instead.")
    public class let didChangeStatusBarOrientationNotification: NSNotification.Name // userInfo contains NSNumber with old orientation

    @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Use viewWillTransitionToSize:withTransitionCoordinator: instead.")
    public class let statusBarOrientationUserInfoKey: String // userInfo dictionary key for status bar orientation

    @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Use viewWillTransitionToSize:withTransitionCoordinator: instead.")
    public class let willChangeStatusBarFrameNotification: NSNotification.Name // userInfo contains NSValue with new frame

    @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Use viewWillTransitionToSize:withTransitionCoordinator: instead.")
    public class let didChangeStatusBarFrameNotification: NSNotification.Name // userInfo contains NSValue with old frame

    @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Use viewWillTransitionToSize:withTransitionCoordinator: instead.")
    public class let statusBarFrameUserInfoKey: String // userInfo dictionary key for status bar frame

    @available(iOS 7.0, *)
    public class let backgroundRefreshStatusDidChangeNotification: NSNotification.Name

    
    @available(iOS 4.0, *)
    public class let protectedDataWillBecomeUnavailableNotification: NSNotification.Name

    @available(iOS 4.0, *)
    public class let protectedDataDidBecomeAvailableNotification: NSNotification.Name

    
    // userInfo contains NSURL with launch URL
    // userInfo contains NSString with bundle ID of the originating application; non-nil if the originating application and this application share the same team identifier
    // userInfo contains NSDictionary with payload
    // userInfo contains a UILocalNotification
    // userInfo contains object with annotation property list
    // app was launched in response to a CoreLocation event.
    // userInfo contains an NSArray of NKAssetDownload identifiers
    // userInfo contains an NSArray of CBCentralManager restore identifiers
    // userInfo contains an NSArray of CBPeripheralManager restore identifiers
    // userInfo contains the UIApplicationShortcutItem used to launch the app.
    // userInfo contains a UIEventAttribution to go along with a URL open on launch
    
    // Key in options dict passed to application:[will | did]FinishLaunchingWithOptions and info for UIApplicationDidFinishLaunchingNotification
    // Sub-Dictionary present in launch options when user activity is present
    // Key in user activity dictionary for the activity type
    // The presence of this key indicates that the app was launched in order to handle a CloudKit sharing invitation. The value of this key is a CKShareMetadata object.
    
    @available(iOS 8.0, *)
    public class let openSettingsURLString: String

    
    // Keys for application:openURL:options:
    // value is an NSString containing the bundle ID of the originating application; non-nil if the originating application and this application share the same team identifier
    // value is a property-list typed object corresponding to what the originating application passed in UIDocumentInteractionController's annotation property
    // value is a bool NSNumber. Copy the file before use if this value is NO, or is not present.
    // value is a UIEventAttribution to go along with the URL to open
    
    // This notification is posted after the user takes a screenshot (for example by pressing both the home and lock screen buttons)
    @available(iOS 7.0, *)
    public class let userDidTakeScreenshotNotification: NSNotification.Name

    @available(iOS 6.0, *)
    public class let invalidInterfaceOrientationException: NSExceptionName

    @available(iOS 4.0, *)
    public enum State : Int {

        case active = 0

        case inactive = 1

        case background = 2
    }

    @available(iOS 7.0, *)
    public class let backgroundFetchIntervalMinimum: TimeInterval

    @available(iOS 7.0, *)
    public class let backgroundFetchIntervalNever: TimeInterval

    public struct OpenExternalURLOptionsKey : Hashable, Equatable, RawRepresentable {

        public init(rawValue: String)
    }
}
public protocol UIApplicationDelegate : NSObjectProtocol {

    @available(iOS 2.0, *)
    optional func applicationDidFinishLaunching(_ application: UIApplication)

    @available(iOS 6.0, *)
    optional func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool

    @available(iOS 3.0, *)
    optional func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool

    @available(iOS 2.0, *)
    optional func applicationDidBecomeActive(_ application: UIApplication)

    @available(iOS 2.0, *)
    optional func applicationWillResignActive(_ application: UIApplication)

    @available(iOS, introduced: 2.0, deprecated: 9.0)
    optional func application(_ application: UIApplication, handleOpen url: URL) -> Bool

    @available(iOS, introduced: 4.2, deprecated: 9.0)
    optional func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool

    @available(iOS 9.0, *)
    optional func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool

    @available(iOS 2.0, *)
    optional func applicationDidReceiveMemoryWarning(_ application: UIApplication)

    @available(iOS 2.0, *)
    optional func applicationWillTerminate(_ application: UIApplication)

    @available(iOS 2.0, *)
    optional func applicationSignificantTimeChange(_ application: UIApplication)

    @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Use viewWillTransitionToSize:withTransitionCoordinator: instead.")
    optional func application(_ application: UIApplication, willChangeStatusBarOrientation newStatusBarOrientation: UIInterfaceOrientation, duration: TimeInterval)

    @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Use viewWillTransitionToSize:withTransitionCoordinator: instead.")
    optional func application(_ application: UIApplication, didChangeStatusBarOrientation oldStatusBarOrientation: UIInterfaceOrientation)

    @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Use viewWillTransitionToSize:withTransitionCoordinator: instead.")
    optional func application(_ application: UIApplication, willChangeStatusBarFrame newStatusBarFrame: CGRect)

    @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Use viewWillTransitionToSize:withTransitionCoordinator: instead.")
    optional func application(_ application: UIApplication, didChangeStatusBarFrame oldStatusBarFrame: CGRect)

    @available(iOS, introduced: 8.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenter requestAuthorizationWithOptions:completionHandler:]")
    optional func application(_ application: UIApplication, didRegister notificationSettings: UIUserNotificationSettings)

    @available(iOS 3.0, *)
    optional func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data)

    @available(iOS 3.0, *)
    optional func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error)

    @available(iOS, introduced: 3.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenterDelegate willPresentNotification:withCompletionHandler:] or -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:] for user visible notifications and -[UIApplicationDelegate application:didReceiveRemoteNotification:fetchCompletionHandler:] for silent remote notifications")
    optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any])

    @available(iOS, introduced: 4.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenterDelegate willPresentNotification:withCompletionHandler:] or -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]")
    optional func application(_ application: UIApplication, didReceive notification: UILocalNotification)

    @available(iOS, introduced: 8.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]")
    optional func application(_ application: UIApplication, handleActionWithIdentifier identifier: String?, for notification: UILocalNotification, completionHandler: @escaping () -> Void)

    @available(iOS, introduced: 9.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]")
    optional func application(_ application: UIApplication, handleActionWithIdentifier identifier: String?, forRemoteNotification userInfo: [AnyHashable : Any], withResponseInfo responseInfo: [AnyHashable : Any], completionHandler: @escaping () -> Void)

    @available(iOS, introduced: 8.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]")
    optional func application(_ application: UIApplication, handleActionWithIdentifier identifier: String?, forRemoteNotification userInfo: [AnyHashable : Any], completionHandler: @escaping () -> Void)

    @available(iOS, introduced: 9.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]")
    optional func application(_ application: UIApplication, handleActionWithIdentifier identifier: String?, for notification: UILocalNotification, withResponseInfo responseInfo: [AnyHashable : Any], completionHandler: @escaping () -> Void)

    /** This delegate method offers an opportunity for applications with the "remote-notification" background mode to fetch appropriate new data in response to an incoming remote notification. You should call the fetchCompletionHandler as soon as you're finished performing that operation, so the system can accurately estimate its power and data cost.
     
     This method will be invoked even if the application was launched or resumed because of the remote notification. The respective delegate methods will be invoked first. Note that this behavior is in contrast to application:didReceiveRemoteNotification:, which is not called in those cases, and which will not be invoked if this method is implemented. !*/
    @available(iOS 7.0, *)
    optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void)

    /** This delegate method offers an opportunity for applications with the "remote-notification" background mode to fetch appropriate new data in response to an incoming remote notification. You should call the fetchCompletionHandler as soon as you're finished performing that operation, so the system can accurately estimate its power and data cost.
     
     This method will be invoked even if the application was launched or resumed because of the remote notification. The respective delegate methods will be invoked first. Note that this behavior is in contrast to application:didReceiveRemoteNotification:, which is not called in those cases, and which will not be invoked if this method is implemented. !*/
    @available(iOS 7.0, *)
    optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) async -> UIBackgroundFetchResult

    /// Applications with the "fetch" background mode may be given opportunities to fetch updated content in the background or when it is convenient for the system. This method will be called in these situations. You should call the fetchCompletionHandler as soon as you're finished performing that operation, so the system can accurately estimate its power and data cost.
    @available(iOS, introduced: 7.0, deprecated: 13.0, message: "Use a BGAppRefreshTask in the BackgroundTasks framework instead")
    optional func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void)

    @available(iOS 9.0, *)
    optional func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void)

    @available(iOS 9.0, *)
    optional func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem) async -> Bool

    @available(iOS 7.0, *)
    optional func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String, completionHandler: @escaping () -> Void)

    @available(iOS 7.0, *)
    optional func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String) async

    @available(iOS 8.2, *)
    optional func application(_ application: UIApplication, handleWatchKitExtensionRequest userInfo: [AnyHashable : Any]?, reply: @escaping ([AnyHashable : Any]?) -> Void)

    @available(iOS 8.2, *)
    optional func application(_ application: UIApplication, handleWatchKitExtensionRequest userInfo: [AnyHashable : Any]?) async -> [AnyHashable : Any]?

    @available(iOS 9.0, *)
    optional func applicationShouldRequestHealthAuthorization(_ application: UIApplication)

    @available(iOS 14.0, *)
    optional func application(_ application: UIApplication, handlerFor intent: INIntent) -> Any?

    @available(iOS, introduced: 11.0, deprecated: 14.0, message: "Use application:handlerForIntent: instead")
    optional func application(_ application: UIApplication, handle intent: INIntent, completionHandler: @escaping (INIntentResponse) -> Void)

    @available(iOS, introduced: 11.0, deprecated: 14.0, message: "Use application:handlerForIntent: instead")
    optional func application(_ application: UIApplication, handle intent: INIntent) async -> INIntentResponse

    @available(iOS 4.0, *)
    optional func applicationDidEnterBackground(_ application: UIApplication)

    @available(iOS 4.0, *)
    optional func applicationWillEnterForeground(_ application: UIApplication)

    @available(iOS 4.0, *)
    optional func applicationProtectedDataWillBecomeUnavailable(_ application: UIApplication)

    @available(iOS 4.0, *)
    optional func applicationProtectedDataDidBecomeAvailable(_ application: UIApplication)

    @available(iOS 5.0, *)
    optional var window: UIWindow? { get set }

    @available(iOS 6.0, *)
    optional func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask

    @available(iOS 8.0, *)
    optional func application(_ application: UIApplication, shouldAllowExtensionPointIdentifier extensionPointIdentifier: UIApplication.ExtensionPointIdentifier) -> Bool

    @available(iOS 6.0, *)
    optional func application(_ application: UIApplication, viewControllerWithRestorationIdentifierPath identifierComponents: [String], coder: NSCoder) -> UIViewController?

    @available(iOS 13.2, *)
    optional func application(_ application: UIApplication, shouldSaveSecureApplicationState coder: NSCoder) -> Bool

    @available(iOS 13.2, *)
    optional func application(_ application: UIApplication, shouldRestoreSecureApplicationState coder: NSCoder) -> Bool

    @available(iOS 6.0, *)
    optional func application(_ application: UIApplication, willEncodeRestorableStateWith coder: NSCoder)

    @available(iOS 6.0, *)
    optional func application(_ application: UIApplication, didDecodeRestorableStateWith coder: NSCoder)

    @available(iOS, introduced: 6.0, deprecated: 13.2, message: "Use application:shouldSaveSecureApplicationState: instead")
    optional func application(_ application: UIApplication, shouldSaveApplicationState coder: NSCoder) -> Bool

    @available(iOS, introduced: 6.0, deprecated: 13.2, message: "Use application:shouldRestoreSecureApplicationState: instead")
    optional func application(_ application: UIApplication, shouldRestoreApplicationState coder: NSCoder) -> Bool

    @available(iOS 8.0, *)
    optional func application(_ application: UIApplication, willContinueUserActivityWithType userActivityType: String) -> Bool

    @available(iOS 8.0, *)
    optional func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool

    @available(iOS 8.0, *)
    optional func application(_ application: UIApplication, didFailToContinueUserActivityWithType userActivityType: String, error: Error)

    @available(iOS 8.0, *)
    optional func application(_ application: UIApplication, didUpdate userActivity: NSUserActivity)

    @available(iOS 10.0, *)
    optional func application(_ application: UIApplication, userDidAcceptCloudKitShareWith cloudKitShareMetadata: CKShareMetadata)

    @available(iOS 13.0, *)
    optional func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration

    @available(iOS 13.0, *)
    optional func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>)

    @available(iOS 15.0, *)
    optional func applicationShouldAutomaticallyLocalizeKeyCommands(_ application: UIApplication) -> Bool
}

extension UIApplicationDelegate {

    public static func main()
}
extension UIApplication {

    @available(iOS, introduced: 2.0, deprecated: 9.0, message: "Explicit setting of the status bar orientation is more limited in iOS 6.0 and later")
    open func setStatusBarOrientation(_ interfaceOrientation: UIInterfaceOrientation, animated: Bool)

    @available(iOS, introduced: 2.0, deprecated: 9.0, message: "Use -[UIViewController preferredStatusBarStyle]")
    open func setStatusBarStyle(_ statusBarStyle: UIStatusBarStyle, animated: Bool)

    @available(iOS, introduced: 3.2, deprecated: 9.0, message: "Use -[UIViewController prefersStatusBarHidden]")
    open func setStatusBarHidden(_ hidden: Bool, with animation: UIStatusBarAnimation)

    @available(iOS, introduced: 4.0, deprecated: 9.0, message: "Please use PushKit for VoIP applications instead of calling this method")
    open func setKeepAliveTimeout(_ timeout: TimeInterval, handler keepAliveHandler: (() -> Void)? = nil) -> Bool

    @available(iOS, introduced: 4.0, deprecated: 9.0, message: "Please use PushKit for VoIP applications instead of calling this method")
    open func clearKeepAliveTimeout()
}
public func UIApplicationMain(_ argc: Int32, _ argv: UnsafeMutablePointer<UnsafeMutablePointer<CChar>?>, _ principalClassName: String?, _ delegateClassName: String?) -> Int32
extension RunLoop.Mode {

    public static let tracking: RunLoop.Mode
}
extension UIApplication.LaunchOptionsKey {

    @available(iOS 3.0, *)
    public static let url: UIApplication.LaunchOptionsKey

    @available(iOS 3.0, *)
    public static let sourceApplication: UIApplication.LaunchOptionsKey

    @available(iOS 3.0, *)
    public static let remoteNotification: UIApplication.LaunchOptionsKey

    @available(iOS, introduced: 4.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]")
    public static let localNotification: UIApplication.LaunchOptionsKey

    @available(iOS 3.2, *)
    public static let annotation: UIApplication.LaunchOptionsKey

    @available(iOS 4.0, *)
    public static let location: UIApplication.LaunchOptionsKey

    @available(iOS 5.0, *)
    public static let newsstandDownloads: UIApplication.LaunchOptionsKey

    @available(iOS 7.0, *)
    public static let bluetoothCentrals: UIApplication.LaunchOptionsKey

    @available(iOS 7.0, *)
    public static let bluetoothPeripherals: UIApplication.LaunchOptionsKey

    @available(iOS 9.0, *)
    public static let shortcutItem: UIApplication.LaunchOptionsKey

    @available(iOS 14.5, *)
    public static let eventAttribution: UIApplication.LaunchOptionsKey

    @available(iOS 8.0, *)
    public static let userActivityDictionary: UIApplication.LaunchOptionsKey

    @available(iOS 8.0, *)
    public static let userActivityType: UIApplication.LaunchOptionsKey

    @available(iOS 10.0, *)
    public static let cloudKitShareMetadata: UIApplication.LaunchOptionsKey
}
extension UIApplication.OpenURLOptionsKey {

    @available(iOS 9.0, *)
    public static let sourceApplication: UIApplication.OpenURLOptionsKey

    @available(iOS 9.0, *)
    public static let annotation: UIApplication.OpenURLOptionsKey

    @available(iOS 9.0, *)
    public static let openInPlace: UIApplication.OpenURLOptionsKey

    @available(iOS 14.5, *)
    public static let eventAttribution: UIApplication.OpenURLOptionsKey
}
extension UIApplication.ExtensionPointIdentifier {

    
    @available(iOS 8.0, *)
    public static let keyboard: UIApplication.ExtensionPointIdentifier
}
extension UIApplication.OpenExternalURLOptionsKey {

    
    @available(iOS 10.0, *)
    public static let universalLinksOnly: UIApplication.OpenExternalURLOptionsKey

    
    // Option for openURL:options:CompletionHandler: to provide an event attribution to go along with the openURL call.
    @available(iOS 14.5, *)
    public static let eventAttribution: UIApplication.OpenExternalURLOptionsKey // value is a UIEventAttribution
}

